🎖️GitЯра🎖️
Node / meshtastic / Meshtastic-Android / files / build-logic / convention / src / main / kotlin / org / meshtastic / buildlogic / AndroidCompose.kt
Displaying Raw • Download
build-logic/convention/src/main/kotlin/org/meshtastic/buildlogic/AndroidCompose.kt bd2863243bab6eb213401d949839a2bc74dde7e2 (bd286324) Text, 3.40 KB
T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.buildlogic
Tff7b72import T7ee787com.android.build.api.dsl.CommonExtension
Tff7b72import T7ee787org.gradle.api.Project
Tff7b72import T7ee787org.gradle.kotlin.dsl.dependencies
T8b949e/** Configure Compose-specific options */
Tff7b72internal Tff7b72fun Te6edf3ProjectTb4b4b4.Td2a8ffconfigureAndroidComposeTb4b4b4(Te6edf3commonExtensionTb4b4b4: Te6edf3CommonExtensionTb4b4b4) Tb4b4b4{
Te6edf3commonExtensionTb4b4b4.Te6edf3apply Tb4b4b4{ Te6edf3buildFeaturesTb4b4b4.Te6edf3compose Tff7b72= Tff7b72true Tb4b4b4}
T8b949e// CMP is the sole Compose version authority (BOM removed from the catalog).
T8b949e// Third-party libraries (maps-compose, datadog, etc.) carry a transitive
T8b949e// compose-bom whose constraints conflict with CMP-published AndroidX artifacts.
T8b949e// Exclude it globally so CMP's own dependency graph wins.
Te6edf3configurationsTb4b4b4.Te6edf3configureEach Tb4b4b4{ Te6edf3excludeTb4b4b4(Te6edf3mapOfTb4b4b4(Ta5d6ff"Ta5d6ffgroupTa5d6ff" Te6edf3to Ta5d6ff"Ta5d6ffandroidx.composeTa5d6ff"Tb4b4b4, Ta5d6ff"Ta5d6ffmoduleTa5d6ff" Te6edf3to Ta5d6ff"Ta5d6ffcompose-bomTa5d6ff"Tb4b4b4)Tb4b4b4) Tb4b4b4}
T8b949e// CMP publishes these core AndroidX groups at an AndroidX version tag that
T8b949e// tracks (but does not equal) the CMP version. The exact mapping lives in
T8b949e// the CMP release notes; we mirror it via the `androidx-compose-bom-aligned`
T8b949e// version ref in libs.versions.toml. Material, Material3, and Adaptive follow
T8b949e// separate AndroidX version numbers and must NOT be included here.
Tff7b72val Te6edf3androidxComposeVersion Tff7b72= Te6edf3libsTb4b4b4.Te6edf3versionTb4b4b4(Ta5d6ff"Ta5d6ffandroidx-compose-bom-alignedTa5d6ff"Tb4b4b4)
Tff7b72val Te6edf3cmpAlignedGroups Tff7b72=
Te6edf3setOfTb4b4b4(
Ta5d6ff"Ta5d6ffandroidx.compose.animationTa5d6ff"Tb4b4b4,
Ta5d6ff"Ta5d6ffandroidx.compose.foundationTa5d6ff"Tb4b4b4,
Ta5d6ff"Ta5d6ffandroidx.compose.runtimeTa5d6ff"Tb4b4b4,
Ta5d6ff"Ta5d6ffandroidx.compose.uiTa5d6ff"Tb4b4b4,
Tb4b4b4)
T8b949e// `androidx.compose.material:material` is ALSO requested version-less by maps-compose-widgets,
T8b949e// but it is pinned via an explicit versioned dependency in :androidApp rather than forced here —
T8b949e// a force does not cross the project boundary, so consumers of the app's graph (e.g.
T8b949e// :baselineprofile) would otherwise re-orphan it. Do not re-add a force for it here.
Te6edf3configurationsTb4b4b4.Te6edf3configureEach Tb4b4b4{
Te6edf3resolutionStrategyTb4b4b4.Te6edf3eachDependency Tb4b4b4{
Tff7b72if Tb4b4b4(Te6edf3requestedTb4b4b4.Te6edf3group Tff7b72in Te6edf3cmpAlignedGroupsTb4b4b4) Tb4b4b4{
Te6edf3useVersionTb4b4b4(Te6edf3androidxComposeVersionTb4b4b4)
Tb4b4b4}
Tb4b4b4}
Tb4b4b4}
Tff7b72val Te6edf3hasAndroidTest Tff7b72= Te6edf3projectTb4b4b4.Te6edf3projectDirTb4b4b4.Te6edf3resolveTb4b4b4(Ta5d6ff"Ta5d6ffsrc/androidTestTa5d6ff"Tb4b4b4)Tb4b4b4.Te6edf3existsTb4b4b4(Tb4b4b4)
Te6edf3dependencies Tb4b4b4{
Ta5d6ff"Ta5d6ffdebugImplementationTa5d6ff"Tb4b4b4(Te6edf3libsTb4b4b4.Te6edf3libraryTb4b4b4(Ta5d6ff"Ta5d6ffcompose-multiplatform-ui-toolingTa5d6ff"Tb4b4b4)Tb4b4b4)
Ta5d6ff"Ta5d6ffimplementationTa5d6ff"Tb4b4b4(Te6edf3libsTb4b4b4.Te6edf3libraryTb4b4b4(Ta5d6ff"Ta5d6ffcompose-multiplatform-runtimeTa5d6ff"Tb4b4b4)Tb4b4b4)
Ta5d6ff"Ta5d6ffruntimeOnlyTa5d6ff"Tb4b4b4(Te6edf3libsTb4b4b4.Te6edf3libraryTb4b4b4(Ta5d6ff"Ta5d6ffandroidx-compose-runtime-tracingTa5d6ff"Tb4b4b4)Tb4b4b4)
Ta5d6ff"Ta5d6ffimplementationTa5d6ff"Tb4b4b4(Te6edf3libsTb4b4b4.Te6edf3libraryTb4b4b4(Ta5d6ff"Ta5d6ffcompose-multiplatform-resourcesTa5d6ff"Tb4b4b4)Tb4b4b4)
T8b949e// Add Espresso explicitly to avoid version mismatch issues on newer Android versions
Tff7b72if Tb4b4b4(Te6edf3hasAndroidTestTb4b4b4) Tb4b4b4{
Ta5d6ff"Ta5d6ffandroidTestImplementationTa5d6ff"Tb4b4b4(Te6edf3libsTb4b4b4.Te6edf3libraryTb4b4b4(Ta5d6ff"Ta5d6ffandroidx-test-espresso-coreTa5d6ff"Tb4b4b4)Tb4b4b4)
Tb4b4b4}
Tb4b4b4}
Te6edf3configureComposeCompilerTb4b4b4(Tb4b4b4)
Tb4b4b4}
Served by rngit 1.5.0 - Generated in 0.12s